﻿///<reference path="../../jquery-1.3.2-vsdoc.js" />
///<reference path="../Shell/Base.js" />
///<reference path="Dashboard.Manager.GadgetAdd.js" />
///<reference path="Dashboard.Manager.Gadget.js" />
///<reference path="Dashboard.Manager.TabView.js" />

(function($, epi) {
    epi = epi || {};
    epi.dashboard = epi.dashboard || {};

    epi.dashboard.manager = epi.dashboard.manager || {};

    epi.shell.registerInitFunction(function() {
        epi.dashboard.manager.init();
    });

    epi.dashboard.manager = function() {

        var _sharedResourceKey = "EPiServer.Shell.Resources.Texts";
        var _dashboardResourceKey = "EPiServer.Shell.UI.Views.Dashboard.Resources";

        var pub = {};

        pub.feedback;

      /*  _handleAjaxError = function(e, errorInfo) {
            //Use default feedback area
            pub.feedback.epiFeedback("setErrorMessage",
                epi.shell.resource.get(_sharedResourceKey, "InternalServerError") + " [" + errorInfo.xmlHttpRequest.status + "]", errorInfo.xmlHttpRequest.responseText);
        };*/

        pub.init = function() {
            /// <summary>
            ///    Init function for epi.dashboard.manager
            /// </summary>
            //epi.dashboard.manager.gadgetAdd.init();
            //epi.dashboard.manager.tabView.init();
            epi.dashboard.manager.gadget.init();

            pub.feedback = $("#feedback");
            //Listen to ajax request errors
           // $(document).bind("epiajaxrequestfailed", _handleAjaxError);

           /* if (pub.feedback.size() > 0) {
                pub.feedback.epiFeedback(
                {
                    closeButtonText: epi.shell.resource.get(_sharedResourceKey, "Close"),
                    closeButtonDescription: epi.shell.resource.get(_dashboardResourceKey, "FeedbackCloseDescription")
                });
            }*/

          //  epi.shell.layout.initScrollableArea({ area: ".epi-dashboardTabPanelContainer", content: ".epi-dashboardTabPanel:visible" });
        };

        return pub;
    } ();

})(epiJQuery, epi);






